package shiqi.SimpleFactory;
/*
简单工厂
 */
public class PayMethodFactory {

    public static AbstractPay getPayMethod(String type) {
        if (type.equalsIgnoreCase("cash")) {
            return new CashPay();
        } else if (type.equalsIgnoreCase("creditcard")) {
            return new CreditcardPay();
        }
        return null;
    }
}
